import request from '@/utils/request'

//注册接口
export const userRegisterService = ({username, password, repassword}) =>{
  return request.post('/api/register',{username, password, repassword})
}

//登录接口
export const userLoginService = ({ username, password}) => 
request.post('/employee/login',{ username, password})

 // 分页查询
 export const getEmployeeList = (params) =>
 request({
   'url': `/employee/page`,
   'method': 'get',
   'params': params
 })


 // 启用禁用员工账号
export const enableOrDisableEmployee = (params) =>
request({
  'url': `/employee/status/${params.status}`,
  'method': 'POST',
  'params': {id: params.id}
})


// 新增员工
export const addEmployee = (params) =>
request({
  'url': '/employee',
  'method': 'POST',
  'data': params
})

// 根据id查询员工
export const queryEmployeeById = (id) =>
request({
  'url': `/employee/${id}`,
  'method': 'GET'
})

// 修改员工
export const updateEmployee = (params) =>
request({
  'url': '/employee',
  'method': 'PUT',
  'data': params
})